<?php 
$this->E_D("DROP TABLE IF EXISTS `db_feedback_field`;");
$this->E_C("CREATE TABLE `db_feedback_field` (
  `field_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `field` varchar(20) NOT NULL DEFAULT '' COMMENT '字段名',
  `name` varchar(30) NOT NULL DEFAULT '' COMMENT '别名',
  `fieldtype` varchar(30) NOT NULL COMMENT '字段类型',
  `fieldlen` varchar(20) NOT NULL COMMENT '长度',
  `formtype` varchar(20) NOT NULL DEFAULT '' COMMENT '字段类型',
  `tips` text COMMENT '字段提示',
  `pattern` varchar(255) NOT NULL DEFAULT '' COMMENT '数据校验正则',
  `errortips` varchar(255) DEFAULT '' COMMENT '数据校验未通过的提示信息',
  `savefun` varchar(255) DEFAULT NULL,
  `sort` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `formwidth` smallint(4) DEFAULT NULL COMMENT '元素宽度',
  `formheight` smallint(4) DEFAULT NULL COMMENT '元素高度',
  `defaultval` text COMMENT '默认值',
  `htmlcode` longtext COMMENT 'html代码',
  PRIMARY KEY (`field_id`),
  KEY `field` (`field`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COMMENT='模型字段列表'");
$this->E_D("replace into `db_feedback_field` values('6','title','标题','varchar','50','text','','','','','0','0','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"title\" id=\"info_title\" class=\"layui-input modelform_title\" value=\"{\$r?\$r[''title'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_feedback_field` values('7','name','姓名','varchar','50','text','','','','','0','0','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"name\" id=\"info_name\" class=\"layui-input modelform_name\" value=\"{\$r?\$r[''name'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_feedback_field` values('8','email','邮箱','varchar','50','text','','/^[\\\\w\\\\-\\\\.]+@[\\\\w\\\\-\\\\.]+(\\\\.\\\\w+)+\$/','邮箱格式不正确','','0','0','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"email\" id=\"info_email\" class=\"layui-input modelform_email\" value=\"{\$r?\$r[''email'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_feedback_field` values('9','mobile','手机','varchar','20','text','','/^(1)[0-9]{10}\$/','手机号码格式不正确','','0','0','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"mobile\" id=\"info_mobile\" class=\"layui-input modelform_mobile\" value=\"{\$r?\$r[''mobile'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_feedback_field` values('10','content','内容','text','','textarea','','','','','22','0','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}</label>
  <div class=\"layui-input-inline\">
	<textarea autocomplete=\"off\" name=\"content\" id=\"info_content\" style=\"\" class=\"layui-input\">{\$r?\$r[''content'']:''''}</textarea>
  </div>
</div>	');");
$this->E_D("replace into `db_feedback_field` values('11','sex','女','varchar','20','radio','','','','','0','0','0','男==1:default
女==0','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	  <div class=\"layui-col-md12\">
		<label><input type=\"radio\"  name=\"sex\" value=\"1\" title=\"男\" {:\$r[''sex'']==''1''?\"checked\":\"\"} {\$r?\"\":\"checked\"}/>男</label><label><input type=\"radio\"  name=\"sex\" value=\"0\" title=\"女\" {:\$r[''sex'']==''0''?\"checked\":\"\"} />女</label>
	  </div>
  </div>
</div>');");
$this->E_D("replace into `db_feedback_field` values('14','endtime','截止时间','int','11','date','','','','','0','0','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" autocomplete=\"off\" name=\"endtime\" id=\"info_endtime\" value=\"<?=\$r?date(\"Y-m-d H:i:s\",\$r[''endtime'']):date(\"Y-m-d H:i:s\")?>\" style=\"\"  data-format=\"yyyy-MM-dd HH:mm:ss\" class=\"layui-input form-date\">
  </div>
</div>');");
$this->E_D("replace into `db_feedback_field` values('15','listqingdan','联系人清单','text','','morevalue','','','','','0','0','0','姓名{{FieldSplit}}text{{FieldSplit}}{{FieldSplit}}20{{RsSplit}}手机{{FieldSplit}}text{{FieldSplit}}{{FieldSplit}}20','<div class=\"layui-form-item\">
	<label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
    <div class=\"layui-input-inline morevalue\">
		<script>
			var listqingdan_form_js=''<tr><td class=\"morevalue_input\"><input class=\"layui-input\" placeholder=\"\" value=\"\" name=\"listqingdan_0[]\"></td><td class=\"morevalue_input\"><input class=\"layui-input\" placeholder=\"\" value=\"\" name=\"listqingdan_1[]\"></td><td class=\"morevalue_button\"><a class=\"layui-btn layui-btn-primary layui-btn-sm\" onclick=\"morevalue_add(this,listqingdan_form_js)\">+</a><a class=\"layui-btn layui-btn-primary layui-btn-sm\" onclick=\"morevalue_del(this)\">-</a></td></tr>'';
		</script>
		<table class=\"layui-table\" style=\"border-right:1px solid #ccc\">
			<thead><tr><th style=\"width:20%\">姓名<input type=\"hidden\" name=\"listqingdan_morevalue_len[]\" placeholder=\"我只是用于在保存信息的时候用来判断一共有几个morevalue字段的\"></th><th style=\"width:20%\">手机<input type=\"hidden\" name=\"listqingdan_morevalue_len[]\" placeholder=\"我只是用于在保存信息的时候用来判断一共有几个morevalue字段的\"></th><th style=\"width:10%\">操作</th></tr></thead>
			<tbody>
				<?php
				if(\$r[''listqingdan'']){
					\$morevalue=\$r[''listqingdan''];
					\$morevalue_arr=explode(\"{{RsSplit}}\",\$morevalue);
					foreach(\$morevalue_arr as \$k=> \$v){
						if(!\$v){break;}
						\$vs=explode(\"{{FieldSplit}}\",\$v);
				?>				
				<tr><td class=\"morevalue_input\"><input class=\"layui-input\" placeholder=\"\" value=\"<?=\$r?\$vs[''0'']:''''?>\" name=\"listqingdan_0[]\"></td><td class=\"morevalue_input\"><input class=\"layui-input\" placeholder=\"\" value=\"<?=\$r?\$vs[''1'']:''''?>\" name=\"listqingdan_1[]\"></td><td class=\"morevalue_button\"><a class=\"layui-btn layui-btn-primary layui-btn-sm\" onclick=\"morevalue_add(this,listqingdan_form_js)\">+</a><a class=\"layui-btn layui-btn-primary layui-btn-sm\" onclick=\"morevalue_del(this)\">-</a></td></tr>
				<?php
					}                     
				}else{
				?>
				<tr><td class=\"morevalue_input\"><input class=\"layui-input\" placeholder=\"\" value=\"<?=\$r?\$vs[''0'']:''''?>\" name=\"listqingdan_0[]\"></td><td class=\"morevalue_input\"><input class=\"layui-input\" placeholder=\"\" value=\"<?=\$r?\$vs[''1'']:''''?>\" name=\"listqingdan_1[]\"></td><td class=\"morevalue_button\"><a class=\"layui-btn layui-btn-primary layui-btn-sm\" onclick=\"morevalue_add(this,listqingdan_form_js)\">+</a><a class=\"layui-btn layui-btn-primary layui-btn-sm\" onclick=\"morevalue_del(this)\">-</a></td></tr>
				<?php
				}
				?>									
			</tbody>
		</table>
    </div>
</div>');");
$this->E_D("replace into `db_feedback_field` values('17','city','城市','varchar','50','select','','','','','0','0','0','北京
上海
广州','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
        <select lay-ignore name=\"city\" class=\"select2\" style=\"\"><option value=\"北京\" {\$r[''city'']==''北京''?\"selected\":\"\"} >北京</option><option value=\"上海\" {\$r[''city'']==''上海''?\"selected\":\"\"} >上海</option><option value=\"广州\" {\$r[''city'']==''广州''?\"selected\":\"\"} >广州</option></select>
    </div>
</div>');");
$this->E_D("replace into `db_feedback_field` values('18','hobby','爱好','varchar','255','checkbox','','','','','0','0','0','上网
看电影
听音乐','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	  <div class=\"layui-col-md12\">
		<label><input type=\"checkbox\"  name=\"hobby[]\" value=\"上网\" title=\"上网\" {:strstr(\$r[''hobby''],''|上网|'')?\"checked\":\"\"} />上网</label><label><input type=\"checkbox\"  name=\"hobby[]\" value=\"看电影\" title=\"看电影\" {:strstr(\$r[''hobby''],''|看电影|'')?\"checked\":\"\"} />看电影</label><label><input type=\"checkbox\"  name=\"hobby[]\" value=\"听音乐\" title=\"听音乐\" {:strstr(\$r[''hobby''],''|听音乐|'')?\"checked\":\"\"} />听音乐</label>
	  </div>
  </div>
</div>');");
$this->E_D("replace into `db_feedback_field` values('19','company','公司名称','varchar','','text','','','','','0','0','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"company\" id=\"info_company\" class=\"layui-input modelform_company\" value=\"{\$r?\$r[''company'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");

 ?>